/**
 * Created by fanweihua on 2016/11/30.
 */
import React from 'react';
import InputHtml from './inputHtml.js'

const InputNav = React.createClass({
    render(){
        return (
            <div className="Z_panel-body">
                <div className="page__hd">
                    <h1 className="page__title">Input</h1>
                    <p className="page__desc">表单输入</p>
                </div>
                <div className="page__bd">
                    <div className="weui-cells__title">单选列表项</div>
                    <div className="weui-cells weui-cells_radio">
                        <label className="weui-cell weui-check__label">
                            <div className="weui-cell__bd">
                                <p>cell standard</p>
                            </div>
                            <div className="weui-cell__ft">
                                <input type="radio" className="weui-check" name="radio1"
                                       id="x11"></input>
                                <span className="weui-icon-checked"></span>
                            </div>
                        </label>
                        <label className="weui-cell weui-check__label">

                            <div className="weui-cell__bd">
                                <p>cell standard</p>
                            </div>
                            <div className="weui-cell__ft">
                                <input type="radio" name="radio1" className="weui-check"
                                       id="x12"></input>
                                <span className="weui-icon-checked"></span>
                            </div>
                        </label>
                        <a href="javascript:void(0);" className="weui-cell weui-cell_link">
                            <div className="weui-cell__bd">添加更多</div>
                        </a>
                    </div>
                    <div className="weui-cells__title">复选列表项</div>
                    <div className="weui-cells weui-cells_checkbox">
                        <label className="weui-cell weui-check__label">
                            <div className="weui-cell__hd">
                                <input type="checkbox" className="weui-check" name="checkbox1"
                                       id="s11"></input>
                                <i className="weui-icon-checked"></i>
                            </div>
                            <div className="weui-cell__bd">
                                <p>standard is dealt for u.</p>
                            </div>
                        </label>
                        <label className="weui-cell weui-check__label">
                            <div className="weui-cell__hd">
                                <input type="checkbox" name="checkbox1" className="weui-check"
                                       id="s12"></input>
                                <i className="weui-icon-checked"></i>
                            </div>
                            <div className="weui-cell__bd">
                                <p>standard is dealicient for u.</p>
                            </div>
                        </label>
                        <a href="javascript:void(0);" className="weui-cell weui-cell_link">
                            <div className="weui-cell__bd">添加更多</div>
                        </a>
                    </div>

                    <div className="weui-cells__title">表单</div>
                    <div className="weui-cells weui-cells_form">
                        <div className="weui-cell">
                            <div className="weui-cell__hd"><label className="weui-label">qq</label>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="number" pattern="[0-9]*"
                                       placeholder="请输入qq号"></input>
                            </div>
                        </div>
                        <div className="weui-cell weui-cell_vcode">
                            <div className="weui-cell__hd">
                                <label className="weui-label">手机号</label>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="tel"
                                       placeholder="请输入手机号"></input>
                            </div>
                            <div className="weui-cell__ft">
                                <button className="weui-vcode-btn">获取验证码</button>
                            </div>
                        </div>
                        <div className="weui-cell">
                            <div className="weui-cell__hd"><label className="weui-label">日期</label>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="date"></input>
                            </div>
                        </div>
                        <div className="weui-cell">
                            <div className="weui-cell__hd"><label className="weui-label">时间</label>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="datetime-local"
                                       placeholder=""></input>
                            </div>
                        </div>
                        <div className="weui-cell weui-cell_vcode">
                            <div className="weui-cell__hd"><label className="weui-label">验证码</label>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="number"
                                       placeholder="请输入验证码"></input>
                            </div>
                            <div className="weui-cell__ft">
                                <img className="weui-vcode-img"
                                     src="/bower_components/weui-master/example/images/vcode.jpg"></img>
                            </div>
                        </div>
                    </div>
                    <div className="weui-cells__tips">底部说明文字底部说明文字</div>

                    <div className="weui-cells__title">表单报错</div>
                    <div className="weui-cells weui-cells_form">
                        <div className="weui-cell weui-cell_warn">
                            <div className="weui-cell__hd"><label className="weui-label">卡号</label>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="number" pattern="[0-9]*"
                                       value="weui input error" onChange={this.handleChange}
                                       placeholder="请输入卡号"></input>
                            </div>
                            <div className="weui-cell__ft">
                                <i className="weui-icon-warn"></i>
                            </div>
                        </div>
                    </div>
                    <div className="weui-cells__title">开关</div>
                    <div className="weui-cells weui-cells_form">
                        <div className="weui-cell weui-cell_switch">
                            <div className="weui-cell__bd">标题文字</div>
                            <div className="weui-cell__ft">
                                <input className="weui-switch" type="checkbox"></input>
                            </div>
                        </div>
                        <div className="weui-cell weui-cell_switch">
                            <div className="weui-cell__bd">兼容IE Edge的版本</div>
                            <div className="weui-cell__ft">
                                <label className="weui-switch-cp">
                                    <input id="switchCP" className="weui-switch-cp__input"
                                           type="checkbox"></input>
                                    <div className="weui-switch-cp__box"></div>
                                </label>
                            </div>
                        </div>
                    </div>
                    <div className="weui-cells__title">文本框</div>
                    <div className="weui-cells">
                        <div className="weui-cell">
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="text"
                                       placeholder="请输入文本"></input>
                            </div>
                        </div>
                    </div>
                    <div className="weui-cells__title">文本域</div>
                    <div className="weui-cells weui-cells_form">
                        <div className="weui-cell">
                            <div className="weui-cell__bd">
                                                <textarea className="weui-textarea" placeholder="请输入文本"
                                                          rows="3"></textarea>
                                <div className="weui-textarea-counter"><span>0</span>/200</div>
                            </div>
                        </div>
                    </div>
                    <div className="weui-cells__title">选择</div>
                    <div className="weui-cells">
                        <div className="weui-cell weui-cell_select weui-cell_select-before">
                            <div className="weui-cell__hd">
                                <select className="weui-select" name="select2">
                                    <option value="1">+86</option>
                                    <option value="2">+80</option>
                                    <option value="3">+84</option>
                                    <option value="4">+87</option>
                                </select>
                            </div>
                            <div className="weui-cell__bd">
                                <input className="weui-input" type="number" pattern="[0-9]*"
                                       placeholder="请输入号码"></input>
                            </div>
                        </div>
                    </div>
                    <div className="weui-cells__title">选择</div>
                    <div className="weui-cells">
                        <div className="weui-cell weui-cell_select">
                            <div className="weui-cell__bd">
                                <select className="weui-select" name="select1">
                                    <option value="1">微信号</option>
                                    <option value="2">QQ号</option>
                                    <option value="3">Email</option>
                                </select>
                            </div>
                        </div>
                        <div className="weui-cell weui-cell_select weui-cell_select-after">
                            <div className="weui-cell__hd">
                                <label className="weui-label">国家/地区</label>
                            </div>
                            <div className="weui-cell__bd">
                                <select className="weui-select" name="select2">
                                    <option value="1">中国</option>
                                    <option value="2">美国</option>
                                    <option value="3">英国</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <label className="weui-agree">
                        <input id="weuiAgree" type="checkbox"
                               className="weui-agree__checkbox"></input>
                        <span className="weui-agree__text">阅读并同意<a
                            href="javascript:void(0);">《相关条款》</a></span>
                    </label>
                    <div className="weui-btn-area">
                        <a className="weui-btn weui-btn_primary" href="javascript:"
                           id="showTooltips">确定</a>
                    </div>
                </div>
            </div>
        );
    }
});

const Input = React.createClass({
    handleChange: function (event) {
        this.setState({value: event.target.value});
    },
    getInitialState: function () {
        return {
            html: InputHtml.html
        };
    },
    render() {
        return (
            <div className="Z_slideIn">
                <div className="page slideIn">
                    <div className="Z_content_code">
                        <div dangerouslySetInnerHTML={{__html: this.state.html}}></div>
                    </div>
                </div>
                <div className="Z_content">
                    <div className="Z_panel-body-backgound">
                        <InputNav></InputNav>
                    </div>
                </div>
            </div>
        );
    }
});
module.exports = Input;